import './page.scss'
import { lazy, Suspense, useState } from 'react'
import { useMount } from 'ahooks';
import { useParams } from 'react-router-dom'
import { useEffect } from 'react';

const Page = () => {
    const pramas = useParams()
    const [Templatem, setTemplate] = useState()
    const [Uuid, setUuid] = useState()

    useEffect(() => {
        const { page, uuid } = pramas
        const ThemeTemp = lazy(() => import(`./page/${page}.jsx`))
        setTemplate(ThemeTemp)
        setUuid(uuid)
    }, [pramas])

    return (
        <Suspense>
            <div className='Page'>
                {Templatem && <Templatem uuid={Uuid} />}
            </div>
        </Suspense>
    );
};

export default Page;